<?xml version="1.0" encoding="utf-8"?>
 <grammar xmlns="http://relaxng.org/ns/structure/1.0">
   <start>
     <element name="library">
       <oneOrMore>
         <element name="book">
           <attribute name="id"/>
           <attribute name="available"/>
           <element name="isbn">
             <text/>
           </element>
           <element name="title">
             <attribute name="xml:lang"/>
             <text/>
           </element>
           <zeroOrMore>
             <ref name="extra-book-content"/>
           </zeroOrMore>
         </element>
       </oneOrMore>
     </element>
   </start>
   <define name="extra-book-content" combine="choice">
     <element name="author">
       <attribute name="id"/>
       <element name="name">
         <text/>
       </element>
       <element name="born">
         <text/>
       </element>
       <optional>
         <element name="dead">
           <text/>
         </element>
       </optional>
     </element>
   </define>
   <define name="extra-book-content" combine="choice">
     <element name="character">
       <attribute name="id"/>
       <element name="name">
         <text/>
       </element>
       <element name="born">
         <text/>
       </element>
       <element name="qualification">
         <text/>
       </element>
     </element>
   </define>
 </grammar>
